import { BaseController, CoolController } from "@cool-midway/core";
import { ProviderCertificateEntity } from "../../entity/certificate";
import { ProviderCertificateService } from "../../service/certificate";
import { Get, Inject, Query } from "@midwayjs/core";

@CoolController({
    api: ['add', 'update', 'info', 'list'],
    entity: ProviderCertificateEntity,
    service: ProviderCertificateService,
})
export class ProviderAppCertificateController extends BaseController {

    @Inject()
    providerCertificateService: ProviderCertificateService;

    @Get('/my', { summary: '获取我的证件信息' })
    async my() {
        return this.ok(await this.providerCertificateService.getMyCertificate());
    }

    @Get('/myById', { summary: '获取我的证件信息ById' })
    async myById(@Query('id') id: number) {
        return this.ok(await this.providerCertificateService.getMyCertificateById(id));
    }

    @Get('/provider', { summary: '根据服务人员ID获取证件信息' })
    async provider(@Query('id') id: number) {
        return this.ok(await this.providerCertificateService.getByProviderId(id));
    }

        
}